<!--
  @author yangjiangming
  @date 2018/11/26 10:00
-->
<!DOCTYPE html SYSTEM "http://www.thymeleaf.org/dtd/xhtml1-strict-thymeleaf-4.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org">

<head>
    <title>蚂蚁修-新增订单</title>

    <th:block th:replace="common/common :: jscss"/>

</head>

<body>

<div class="layui-fluid new-order-page">
    <div class="layui-card">
        <form method="post" onkeydown="if(event.keyCode==13){return false}" action class="layui-form" lay-filter="zmn-order-add-form">

            <input type="hidden" id="platWork" th:value="${orderInfo.platWork}"/>
            <input type="hidden" name="plat" id="plat" th:value="${orderInfo.plat}"/>
            <input type="hidden" name="bizType" id="bizType" th:value="${orderInfo.bizType}"/>
            <input type="hidden" name="longitude" id="longitude" th:value="${orderInfo.longitude}"/>
            <input type="hidden" name="latitude" id="latitude" th:value="${orderInfo.latitude}"/>
            <input type="hidden" name="countyId" id="countyId" th:value="${orderInfo.countyId}"/>
            <input type="hidden" name="servItemType" id="servItemType" th:value="1"/>

            <!-- 新单 -->
            <input type="hidden" name="type" id="type" th:value="1"/>

            <!--意向单-->
            <input type="hidden" name="orderPurposeId" id="orderPurposeId" th:value="${orderInfo.orderPurposeId}"/>
            <input type="hidden" id="district"/>
            <!--地址info-->
            <input type="hidden" id="streetSource" name="streetSource" value="0">
            <input type="hidden" id="communityId">
            <!--<div class="layui-card-header" style="margin-top:10px;"><b>基本信息</b></div>-->
            <div class="layui-split">&nbsp;</div>

            <div>
                <!-- 联系电话 -->
                <div class="layui-form-item">
                    <div class="layui-inline">
                        <label class="layui-form-label layui-form-required">联系电话</label>
                        <div class="layui-input-inline" style="width: 200px;">
                            <!-- 联系电话1 -->
                            <th:block th:replace="common/_orderAddTmpl :: inputOfTelephone1"/>
                        </div>
                        <div class="layui-input-inline" style="width: 200px;">
                            <!-- 联系电话2 -->
                            <input class="layui-input"
                                   id="telephone2"
                                   type="text"
                                   name="telephone2"
                                   lay-verify="tel"
                                   placeholder="电话02"
                                   autocomplete="off" >
                        </div>
                    </div>
                </div>
                <!-- 用户姓名、用户性别 -->
                <div class="layui-form-item">
                    <div class="layui-inline">
                        <label class="layui-form-label layui-form-required">客户姓名</label>
                        <div class="layui-input-inline" style="width: 200px;">
                            <th:block th:replace="common/_orderAddTmpl :: inputOfUserName"/>
                        </div>

                        <div class="layui-input-inline" style="width: 210px">
                            <input type="radio"
                                   name="gender"
                                   th:each="item : ${gender}"
                                   th:value="${item.value}"
                                   th:title="${item.text}"
                                   th:checked="${item.value == orderInfo.gender}">
                        </div>
                    </div>
                </div>
                <!-- 下单渠道 -->
                <div class="layui-form-item">
                    <div class="layui-inline">
                        <label class="layui-form-label layui-form-required">下单渠道</label>
                        <div class="layui-input-inline" style="width: 410px;">
                            <!--                            <select id="channelId" lay-verify="required" name="channelId" lay-ignore style="width: 100%;">
                                                            <option value=""></option>
                                                        </select>-->
                            <select id="channelId" name="channelId" lay-verify="required" lay-filter="channelId" lay-search>
                                <!--<option value=""></option>-->
                                <option th:each="channel : ${channelList}"
                                        th:value="${channel.value}"
                                        th:text="${channel.text}"
                                        th:disabled="${channel.disabled}"
                                        th:plat="${channel.ext1}"
                                        th:selected="${channel.value == orderInfo.channelId}">
                                </option>
                            </select>
                        </div>
                    </div>
                </div>
                <!-- 服务分类、订单类型 -->
                <div class="layui-form-item">
                    <div class="layui-inline">
                        <label class="layui-form-label layui-form-required">服务分类</label>
                        <div class="layui-input-inline" style="width: 200px;">
                            <select id="servCategoryId" name="servCategId" lay-verify="required" lay-search>
                        <!--<select id="servCategoryId" name="servCategId" lay-verify="required" lay-filter="servCategory" lay-search>-->
                                <!--<option value="">全部</option>-->
                                <option th:each="item : ${servCategList}"
                                        th:value="${item.value}"
                                        th:text="${item.text}"
                                        th:selected="${item.value == orderInfo.servCategId}"
                                        data-th-data-pid="${ item.pid }">
                                </option>
                            </select>
                        </div>
                    </div>
                </div>
                <!-- 服务分类、订单类型 -->
                <div class="layui-form-item">
                    <div class="layui-inline">
                        <label class="layui-form-label layui-form-required" >服务产品</label>
                        <div class="layui-input-inline layui-hide" style="width: 200px;" id="dv-show-product">
                            <select class="product-select"
                                    id="showProduct"
                                    name="showProductId"
                                    lay-filter="showProduct"
                                    lay-search>
                                <option value="">请选择</option>
                            </select>
                        </div>

                        <div class="layui-input-inline" style="width: 200px;" id="dv-product">
                            <select class="product-select"
                                    id="product"
                                    name="productId"
                                    lay-filter="product"
                                    lay-search>
                                <!--<option value="">请选择</option>-->
                                <option th:each="item : ${servProductList}"
                                        th:value="${item.value}"
                                        th:text="${item.text}"
                                        th:selected="${item.value == orderInfo.productId}"
                                        data-th-data-unit="${ item.ext1 }"
                                        data-th-data-type="${ item.type }"
                                        data-th-data-pid="${ item.pid }">
                                </option>
                            </select>
                        </div>

                        <div class="layui-input-inline layui-hide" style="width: 230px;">
                            <input type="radio"
                                   name="productShowType"
                                   th:each="item : ${productShowType}"
                                   th:value="${item.value}"
                                   th:title="${item.text}"
                                   th:checked="${item.value} == 1"
                                   lay-verify="required"
                                   lay-filter="product-showtype">
                        </div>
                    </div>
                </div>
                <!-- 服务产品、产品数量、品牌 -->
                <div class="layui-form-item">
                    <div class="layui-inline">
                        <label class="layui-form-label layui-form-required" >产品数量</label>
                        <div class="layui-input-inline" style="width: 200px;">
                            <input class="layui-input"
                                    id="count"
                                    type="text"
                                    name="number"
                                    placeholder="请填写数量"
                                    autocomplete="off"
                                    min="1"
                                    max="10"
                                    lay-verify="required|count"
                                    style="padding-right: 40px">
                            <span class="order-number-unit" id="unit"></span>
                        </div>
<!--                        <div class="layui-input-inline" style="width: 200px;">-->
<!--                            <select id="brand" name="brandId" lay-filter="brand" lay-search>-->
<!--                                <option value="">品牌</option>-->
<!--                                <option th:each="item : ${brandList}" th:value="${item.value}" th:text="${item.text}"></option>-->
<!--                            </select>-->
<!--                        </div>-->
                    </div>
                </div>

                <!-- 用户地址-省、市 -->
                <div class="layui-form-item">
                    <div class="layui-inline">
                        <label class="layui-form-label layui-form-required">用户地址</label>
                        <div class="layui-input-inline" style="width: 200px;">
                            <select id="provinceId" name="provinceId" lay-verify="required" lay-filter="province" lay-search>
                                <option value="">省</option>
                                <option th:each="province : ${provinceList}"
                                        th:value="${province.value}"
                                        th:text="${province.text}"
                                        th:selected="${province.value == orderInfo.provinceId}">
                                </option>
                            </select>
                        </div>
                        <div class="layui-input-inline" style="width: 295px;">
                            <select id="cityId"
                                    name="cityId"
                                    lay-verify="required"
                                    lay-filter="city"
                                    lay-search>
                                <option value="">市</option>
                                <option th:each="item : ${cityList}"
                                        data-th-data-pid="${item.pid}"
                                        th:value="${item.value}"
                                        th:text="${item.text}"
                                        th:selected="${item.value == orderInfo.cityId}">
                                </option>
                            </select>
                        </div>
<!--                        <div class="layui-form-mid layui-word-aux" th:if="${orderInfo.platWork == 2}"><span id="company" class="company"></span></div>-->
                    </div>
                </div>

                <!-- 用户地址-map -->
                <div class="layui-form-item">
                    <div class="layui-inline">
                        <label class="layui-form-label" ></label>
                        <div class="layui-input-inline input-large" id="street-wrapper">
                            <input class="layui-input"
                                   id="customerAddress"
                                   type="text"
                                   name="street"
                                   th:value="${orderInfo.street}"
                                   lay-verify="required"
                                   placeholder="搜索地点，选择小区，街道，大厦..."
                                   autocomplete="off"
                                   style="padding-right: 95px;">
                            <!--搜索建议-->
                            <button class="layui-btn layui-btn-normal" id="btn-map" type="button" style="position: absolute;top: 0;right: 0;">百度地图</button>
                            <div id="suggestPanel" class="suggestPanelBox layui-anim layui-anim-upbit">
                                <ul></ul>
                            </div>
                        </div>
                    </div>
                    <div class="layui-inline">
                        <div class="layui-input-inline" id="county-list">
                        </div>
                    </div>
                </div>
                <!-- 用户地址-门牌 -->
                <div class="layui-form-item">
                    <div class="layui-inline">
                        <label class="layui-form-label"></label>
                        <div class="layui-input-inline input-large">
                            <input class="layui-input"
                                   type="text"
                                   name="address"
                                   maxlength="100"
                                   placeholder="请输入详细楼栋、门牌号"
                                   lay-verify="required"
                                   autocomplete="off">
                        </div>
                    </div>
                </div>
                <!-- 预约时间 -->
                <div class="layui-form-item duty-time-item">
                    <div class="layui-inline">
                        <label class="layui-form-label">预约时间</label>
                        <div class="layui-input-inline layui-inline-text" id="duty-time-wrapper">
                            <span id="duty-time" th:text="${dutyTime}"></span>
                            <a class="btn-duty-time" id="btn-duty-time" href="javascript:void(0);">选择预约时间</a>
                            <button class="layui-btn" style="padding: 0;"></button>
                            <input id="duty-time-input"
                                   type="hidden"
                                   name="dutyTime"
                                   th:value="${dutyTime}"
                                   lay-verify="dutyTime"
                                   style="padding: 0;">
                        </div>
<!--                        <div class="layui-input-inline">-->
<!--                            <input id="duty-time-checkbox"-->
<!--                                   type="checkbox"-->
<!--                                   lay-skin="primary"-->
<!--                                   name=""-->
<!--                                   lay-filter="duty-time-checkbox"-->
<!--                                   title="客户不确定上门时间">-->
<!--                        </div>-->
                    </div>
                </div>
                <!-- 下单备注 -->
                <div class="layui-form-item">
                    <div class="layui-inline">
                        <label class="layui-form-label">下单备注</label>
                        <div class="layui-input-inline input-large">
                            <textarea class="layui-textarea"
                                      name="remark"
                                      maxlength="1000"
                                      placeholder="最长不能超1000个字"></textarea>
                        </div>
                        <span style="color: red;">注意：此处备注工程师APP、用户可见。</span>
                    </div>
                </div>
                <!-- 按钮 -->
                <div class="layui-form-item">
                    <div class="layui-inline">
                        <label class="layui-form-label"></label>
                        <div class="layui-input-inline input-large">
                            <button id="confirmbtn" type="button" class="layui-btn" lay-submit lay-filter="confirmbtn">保存</button>
                        </div>
                    </div>
                </div>
                <div style="height: 1px"></div>
            </div>
        </form>
    </div>
</div>

<script th:inline="javascript">
    var json = {
        servProductList: [[${servProductList}]],
        cityList: [[${cityList}]]
    };

    var addOrderWebAk = [[${#baiduAkUtil.getAddOrderWebAk()}]];

    layui.config({
        base: "/static/js/module/",
        version: 20221013001
    }).extend({
        oms_order_entrustAdd: "order/zmn.oms.order.entrustAdd"
    }).use(['index', 'oms_order_entrustAdd']);
</script>

</body>
</html>